$j().ready(function() { 

    /* ---------------------------------------------------------------------- */
    /*	Portfolio
    /* ---------------------------------------------------------------------- */

    // Needed variables
    var $container = $j('#portfolio-list');
    var $filter = $j('#portfolio-filter');

    // Run Isotope  
    $container.isotope({
        filter: '*',
        layoutMode: 'fitRows',
        animationEngine: 'jQuery',
        animationOptions: {
            duration: 750,
            easing: 'linear'
        }
    });

    // Isotope Filter 
    $filter.find('a').click(function () {
        var selector = $j(this).attr('data-filter');
        $container.isotope({
            filter: selector,
            animationOptions: {
                duration: 750,
                easing: 'linear',
                queue: false
            }
        });
        return false;
    });

    // Portfolio image animation 
    $container.find('img').adipoli({
        startEffect: 'overlay',
        hoverEffect: 'foldLeft'
    });

    // Copy categories to item classes
    $filter.find('a').click(function () {
        var currentOption = $j(this).attr('data-filter');
        $filter.find('a').removeClass('current');
        $j(this).addClass('current');
    });
});